fix(hyperliquid): populate volume24h; fix Kalshi error class kwargs - #1219
Merged
Conversation
…alshi error class kwargs
Hyperliquid:
- fetchRawMarkets and fetchEventsImpl now pull dayNtlVlm per outcome leg
from spotMetaAndAssetCtxs (one extra batched call) and sum Yes+No
notional into volume24h. Previously hardcoded 0 across all HL markets
and events.
- One bulk call, no N+1; falls back to 0 if spotMetaAndAssetCtxs is
unreachable.
Python SDK:
- NetworkError and ExchangeNotAvailable rejected the code/retryable
kwargs that from_server_error always sets. Any 503 from Kalshi or
another venue raised TypeError instead of a typed PmxtError. Now both
accept **kwargs and default-fill their hardcoded values.
Verified via Python SDK against local server:
fetch_events(query='World Cup', exchange='hyperliquid'):
$2,211,178 2026 World Cup Champion
$ 761,324 World Cup: Spain vs Saudi Arabia
...
fetch_events(query='Trump', exchange='kalshi') no longer raises.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hyperliquid
volume24hwas hardcoded to 0 innormalizer.tsfor every market and event. Fixed by pullingdayNtlVlmfromspotMetaAndAssetCtxs(where outcome legs appear ascoin: '#NNNN'), summing Yes+No notional per outcome, and threading the map throughfetchRawMarkets/fetchEventsImpl. One extra batched call, no N+1.Python SDK Kalshi crash:
NetworkError/ExchangeNotAvailable__init__signatures rejected thecode/retryablekwargs thatfrom_server_erroralways passes. Any 503 raisedTypeError: ExchangeNotAvailable.__init__() got an unexpected keyword argument 'code'instead of a typedPmxtError. Both classes now accept**kwargsand default-fill their hardcoded values.Verified locally via Python SDK against
npm run serverfetch_events(exchange='hyperliquid', query='World Cup', limit=8):Top HL markets by
volume24h:fetch_events(exchange='kalshi', query='Trump')no longer raises.Test plan
volume24hfor active HL markets